<template>
  <div>
    <el-form label-width="90px">
      <el-form-item label="设备名称：">
        <el-input v-model="nodeName" class="read_input"></el-input>
      </el-form-item>
      <el-form-item label="设备备注：">
        <el-input v-model="tag" class="read_input"></el-input>
      </el-form-item>
    </el-form>
    <el-table
        :data="tableData"
        border
        stripe
        :cell-style="cellStyle"
        :header-cell-style="headerCellClass"
        :highlight-current-row="true"
        style="width: 100%">
      <el-table-column
          prop="slot"
          label="槽位"
          width="70">
      </el-table-column>
      <el-table-column
          prop="usedEq"
          label="原配置">
      </el-table-column>
      <el-table-column
          prop="nowEq"
          label="当前配置">
        <template slot-scope="scope">
          <span>
            {{ scope.row.nowEq }}
          </span>
        </template>
      </el-table-column>
    </el-table>
    <el-row style="margin-top: 20px">
      <el-col :span="8">
        <div style="margin-left: 31px;margin-top: -7px;padding:0 3px;background-color: #fff;float: left">搜索策略</div>
        <div style="padding: 15px;border: 1px solid #9a9797;line-height: 20px" >
          <el-radio v-model="radio" label="1">同步</el-radio>
          <el-radio v-model="radio" label="2">只增加新资源</el-radio>
        </div>
        <p></p>
      </el-col>
      <el-col :span="16">
        <el-button style="float:right;margin-bottom: 5px;margin-right: 10px;margin-top: 15px" @click="oncloseClick">取消</el-button>
        <el-button style="float:right; margin-bottom: 5px;margin-right: 20px;margin-top: 15px" type="primary">开始更新</el-button>
      </el-col>
    </el-row>


  </div>
</template>

<script>
export default {
  name: "HuntMatchMe",
  data() {
    return {

      nodeName: '',
      tag: '2',
      radio: '1',
      tableData: [
        {
          slot: '槽位1',
          usedEq: '板卡1',
          nowEq: '',
        },
        {
          slot: '槽位2',
          usedEq: '板卡2',
          nowEq: '',
        },
        {
          slot: '槽位3',
          usedEq: '板卡3',
          nowEq: '',
        },
        {
          slot: '槽位4',
          usedEq: '板卡4',
          nowEq: '',
        },
        {
          slot: '槽位5',
          usedEq: '板卡5',
          nowEq: '',
        },
        {
          slot: '槽位6',
          usedEq: '板卡6',
          nowEq: '板卡8',
        },
      ]
    }
  },
  methods:{
    cellStyle({row, column, rowIndex, columnIndex}) {
      if (columnIndex === 0) { //指定坐标rowIndex ：行，columnIndex ：列
        return 'background:#edf8ff' //rgb(105,0,7)
      } else {
        return ''
      }
    },
    headerCellClass({row, rowIndex}) {
      console.log(row,rowIndex)

    },

    oncloseClick() {
      this.$bus.$emit('update:visible', false)  //弹框隐藏，意为panelShow为false
    },
  },
  mounted() {
    this.$bus.$on("node-name", (data) => {
      this.nodeName = data;
      console.log('搜索配置框-收到了右侧设备树点击的节点信息 ： ', this.nodeName);
    });
    this.$bus.$on("level", (data) => {
      this.nodeLevel = data;
      console.log('搜索配置框-收到了右侧设备树点击的层级信息 ： ', this.nodeLevel);
      this.isEnable(this.nodeLevel);
    });
  }
}
</script>

<style scoped>
/*<!--使用css样式穿透,input框的样式就没了-->*/
.read_input >>> .el-input__inner {
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: none;
  border-radius: 0;
}
.hht {
  line-height: 60px;
}
</style>